package SparkMlib;

import org.apache.commons.math3.geometry.Vector;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * <pre>
 * Created with IntelliJ IDEA.
 * User: zhengzhi
 * Date: 2017/4/5
 * To change this template use File | Settings | File Templates.
 * </pre>
 */
public class KmeansLearn {
    public static void main(String[] args) {
//        SparkConf sparkConf = new SparkConf().setAppName("Test").setMaster("local");
//        JavaSparkContext sc = new JavaSparkContext(sparkConf);
//
//        JavaRDD<String> data = sc.textFile("D:\\codeSRc\\KMeans\\kmeans_data.txt");
//        data.map(new Function<String, Vector>() {
//            public Vector call(String s) throws Exception {
//                ;
//            }
//        })


        Date date = new Date(System.currentTimeMillis());
        System.out.println(date);


        Calendar calendar = Calendar.getInstance();
        System.out.println("###");
        System.out.println(calendar.getTime());
        calendar.add(Calendar.DAY_OF_MONTH,-1);

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

        Date date1 = Date.valueOf(format.format(calendar.getTime()));

        System.out.println(date1);
    }
}
